// var connection = require('./constant/mysqlconnection').connection
// var MyUtils = require('./util/utils')

// var myUtils = new MyUtils()

// var mysql2 = require('mysql2')
//
//
// var mysqlPool = mysql2.createPool({
//     host: 'localhost',
//     user: 'root',
//     password: 'wuhaiyang',
//     database: 'dlhotfix',
//     port: 3306
// })
//
//
// mysqlPool.query('SELECT * FROM user', function (err, res) {
//     if (!err) {
//         console.log(util.inspect(res,true))
//     } else {
//         console.log(err)
//     }
// })

// SELECT app.id, version.app_version_code, version.logic_delete_flag from application app left join appversion version on
// app.id = version.application_id where app.logic_delete_flag = '01' AND app.id = '851a6520-b28a-11e7-8581-cf58680f58d9'

// var searchSql = 'select app.id , version.app_version_code,version.logic_delete_flag from application app left join appversion version on ' +
//     'app.id = version.application_id where app.logic_delete_flag = 01 and app.id = ?'
//
// var searchSqlParams = [
//     '851a6520-b28a-11e7-8581-cf58680f58d9'
// ]
//
// connection.query(searchSql, searchSqlParams, function (error, results) {
//     if (!error) {
//         if (results.length == 0) {
//             console.log('请先创建应用')
//         } else {
//             // 判断当前版本号是否已经存在了
//             console.log(isAllowCreateAppVersion(results) ? '允许创建' : '不允许创建')
//         }
//     } else {
//         console.log(error)
//     }
// })










